package com.wdz.entity;

import java.util.List;

/**
 * @Author ：Wu Dazhong
 * @Date :2019/6/15
 * @Description:小组实体测试类
 */
public class Team {

    private Integer id;

    private String teamName;

    private List<String> honors;

    private List<User> teamMembers;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public List<String> getHonors() {
        return honors;
    }

    public void setHonors(List<String> honors) {
        this.honors = honors;
    }

    public List<User> getTeamMembers() {
        return teamMembers;
    }

    public void setTeamMembers(List<User> teamMembers) {
        this.teamMembers = teamMembers;
    }

    //重写toString
    @Override
    public String toString() {
      //遍历出小组所获荣耀
        StringBuffer sbHonors = new StringBuffer("荣耀start-----\n");
        for (String honor:honors) {
            sbHonors.append(honor);
            sbHonors.append("\n");
        }
        sbHonors.append("荣耀end---\n");

        //遍历出小组成员
        StringBuffer sbMembers = new StringBuffer("成员start-----\n");
        for (User user:teamMembers) {
            sbMembers.append(user.toString());
            sbMembers.append("\n");
        }
        sbMembers.append("成员end---\n");
        return "小组id:"+id +"\n"+"小组名字"+teamName+"\n"+"小组所获荣誉："+sbHonors+"\n"+"小组成员："+sbMembers;
    }
}
